#!/usr/bin/env python

from pylab import *

fp = open('weights_dcds.txt', 'w')


# 40个采样点
# @0.975MHz
w_size = 40

for cnt in range(w_size):
    for os in range(16):
#        print('> os = {}'.format(os))
        if os == 1:
            if cnt >= 13 and cnt <= 20:
                w = 1./8
            elif cnt >= 28 and cnt <= 35:
                w = -1./8
            else:
                w = 0
#        elif os == 8:
#            if cnt >= 15 and cnt <= 18:
#                w = 1./4
#            elif cnt >=30 and cnt <= 33:
#                w = -1./4
#            else:
#                w = 0
        else:
            if cnt >= 12 and cnt <= 20:
                w = 1./9
            elif cnt >= 28 and cnt <= 36:
                w = -1./9
            else:
                w = 0

        fp.write('%12.8f '%(w)) 

    fp.write('\n')
fp.close()


#for cnt in range(w_size):
#    for os in range(16):
#        if os == 1:
#            if cnt >= 13 and cnt <= 20:
#                w = 1./8
#            elif cnt >= 28 and cnt <= 35:
#                w = -1./8
#            else:
#                w = 0
#        elif os == 8:
#            if cnt >= 13 and cnt <= 20:
#                w = 1./8
#            elif cnt >= 28 and cnt <= 35:
#                w = -1./8
#            else:
#                w = 0
#        elif os == 13:
#            if cnt >= 13 and cnt <= 20:
#                w = 1./8
#            elif cnt >= 28 and cnt <= 35:
#                w = -1./8
#            else:
#                w = 0
#        else:
#            if cnt >= 12 and cnt <= 20:
#                w = 1./9
#            elif cnt >= 28 and cnt <= 36:
#                w = -1./9
#            else:
#                w = 0

#        fp.write('%12.8f '%(w)) 

#    fp.write('\n')
#fp.close()



